<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Plan PreAdd</title>
        <#include "../../inc/css.ftl">
		<link rel="stylesheet" href="${request.contextPath}/static/asset/jquery-ui/1.11.2/jquery-ui.min.css">
		<link rel="stylesheet" href="${request.contextPath}/static/asset/jquery-ui/1.11.2/jquery-ui.theme.min.css">
		<link rel="stylesheet" href="${request.contextPath}/static/asset/jquery/jquery.autocomplete/jquery.autocomplete.css">
	</head>
	<body class="no-skin">
		<div class="container-fluid">
			<div class="row">
			  <div class="breadcrumbs">
				<ul class="breadcrumb">
					<li><i class="ace-icon fa fa-home home-icon"></i><a href="${request.contextPath}/index.jspx" target="_top">首页</a></li>
					<li><a href="list.jspx">生产管理</a></li>
					<li><a href="list.jspx">生产计划信息</a></li>
					<li class="active">新增</li>
				</ul>
				  <!-- /.breadcrumb -->
			  </div>
			  <!-- /.breadcrumbs -->
			</div>
			<!-- /.row -->
			<div class="row">
				<div class="page-content">
					<div class="page-header">
						<h1>生成计划信息新增</h1>
					</div>
					<div class="row">
						<div class="col-xd-12">
						    <form action="add.jspx" method="post" class="form-horizontal" role="form" id="form-data">
						    	<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right"> 生产计划名称  </label>
									<div class="col-sm-4">
										<input type="text" id="name" name="name" placeholder="名称" class="col-sm-12" />
									</div>
									
									<label class="col-sm-2 control-label no-padding-right"> 编号  </label>
									<div class="col-sm-4">
										<input type="text" id="code" name="code" placeholder="编号" value="${code}" class="col-sm-12" />
										<input type="hidden" name="oldId" value="0">
									</div>
								</div>
								<div class="space-4"></div>
								<div class="form-group">
									<div>
										<a href="javascript:void(0)" id="add_detail" class="btn btn-primary">增加计划详情</a>
										<a id="find_stock" href="" target="_blank" style="display:none">查看BOM相关的库存</a>
									<div>
									<div>
										<table class="table">
											<thead>
												<tr>
													<td>操作</td>
													<td>序号</td>
													<td>订单日期</td>
													<td>物料编号</td>
													<td>规格型号</td>
													<td>长度(米)</td>
													<td>颜色</td>
													<td>工位名称</td>
													<td>完成日期</td>
													<td>任务类型</td>
													<td>备注</td>
												</tr>
											</thead>
											<tbody id="detail_container">
											</tbody>
										</table>
										<script type="text/html" id="plan_detail">
												<tr id="detail_{{id}}">
													<td><span class="ace-icon fa fa-remove" title="删除此信息" style="cursor:pointer; color:red" onclick="product.Plan.delDetail('detail_{{id}}')"></span></td>
													<td>{{id}}</td>
													<td><input type="text" name="startDate_{{id}}" class="datepicker" value="${.now?string("yyyy-MM-dd")}"></td>
													<td data-id="{{id}}"><input type="text" name="code_{{id}}" class="autocomplete" value="{{code}}" size="10"></td>
													<td><input type="text" id="model_{{id}}" name="model_{{id}}"></td>
													<td><input type="text" id="needTotal_{{id}}" name="needTotal_{{id}}" size="6" value="0"></td>
													<td><input type="text" id="color_{{id}}" name="color_{{id}}" size="5"></td>
													<td>
														<select class="station" name="station_{{id}}">
															<option value="0">待分配</option>
														<#list stations as station>
														   <option value="${(station.id)!0}">${(station.name)!''}</option>
														</#list>
														</select>
													</td>
													<td><input type="text" name="finishDate_{{id}}" class="datepicker"></td>
													<td>
														<select id="type_{{id}}" name="type_{{id}}">
															<option value="0" selected>普通</option>
															<option value="1">紧急</option>
														</select>
													</td>
													<td><input type="text" name="memo_{{id}}"></td>
												</tr>
										</script>
										<input type="hidden" name="current_id" id="current_id" value="0">
										<input type="hidden" id="last_code">
									</div>
								</div>
								
								<div class="clearfix form-actions">
									<div class="col-sm-offset-2 col-sm-4">
										<button type="reset" class="btn">
											<i class="ace-icon fa fa-undo bigger-110"></i>
											重置
										</button>
										&nbsp;&nbsp;
										<button id="plan-submit" type="submit" class="btn btn-info">
											<i class="ace-icon fa fa-check bigger-110"></i>
											提交
										</button>
									</div>
								</div>
						    </form>
					    </div>
					</div>
					<!-- /.row -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<#include "../../inc/js.ftl">
		<script src="${request.contextPath}/static/asset/jquery-ui/1.11.2/jquery-ui.min.js"></script>
		<script src="${request.contextPath}/static/asset/jquery/jquery.autocomplete/jquery.autocomplete.min.js"></script>
		<script src="${request.contextPath}/static/asset/jquery/template.js"></script>
		<script src="${request.contextPath}/static/skin/default/js/product-list.js"></script>
		<script>
			$(document).ready(function(){
				product.Plan.setCtx("${request.contextPath}");
				product.Plan.init();
				root.Validator.Plan.validate();
			});
		</script>
	</body>
</html>